package com.example.usermanage.service;

import com.example.usermanage.mapper.UserMapper;
import com.example.usermanage.model.Userinfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    public Userinfo login(String username, String password) {
        return userMapper.login(username,password);
    }

    public int insert(Userinfo userinfo) {
        return userMapper.insert(userinfo);
    }

    public List<Userinfo> listAll() {
        return userMapper.listAll();
    }

    public List<Userinfo> listAllPlus() {
        return userMapper.listAllPlus();
    }

    public Userinfo selectUpdate(Integer id) {
        return userMapper.selectUpdate(id);
    }

    public int update(Userinfo userinfo) {
        return userMapper.update(userinfo);
    }

    public int delete(Integer id) {
        return userMapper.delete(id);
    }
}
